package com.trickytriad.views.viewmodels
{
	import com.trickytriad.events.ui.ChangeMainViewEvent;
	
	import flash.events.EventDispatcher;
	
	/**
	 * Tricky Triad, viewmodel for the MainMenu.
	 * 
	 * EVENTS DISPATCHED:
	 * - CHANGEMAINVIEW_REQUEST: Request to change the main view.
	 */
	[Bindable]
	[Event(name="changeMainViewRequest", type="com.trickytriad.events.ui.ChangeMainViewEvent")]
	[ManagedEvents("changeMainViewRequest")]
	public class MainMenuVM extends EventDispatcher
	{
		
		// Image names
		private var _backgroundImageName:String = App.ASSET_ROOT + "mainmenu.jpg";			
		private var _newsButtonImageName:String = App.ASSET_ROOT + "menu/news.jpg";
		private var _gameButtonImageName:String = App.ASSET_ROOT + "menu/game.jpg";
		private var _storeButtonImageName:String = App.ASSET_ROOT + "menu/store.jpg";
		
		/**
		 * Blank default constructor.  Does nothing.
		 */
		public function MainMenuVM()
		{
		}
		
		/**
		 * Initialization function.
		 */
		public function init() : void
		{
						
		}
		
		/**
		 * Change view function.  Dispatches an event to App to change the view state.
		 */		
		public function changeView (newView : uint) : void
		{			
			dispatchEvent(new ChangeMainViewEvent(ChangeMainViewEvent.CHANGEMAINVIEW_REQUEST, newView));
		}
		
		// Getters
		public function get backgroundImageName () : String { return _backgroundImageName; }
		public function get gameButtonImageName () : String { return _gameButtonImageName; }
		public function get newsButtonImageName () : String { return _newsButtonImageName; }
		public function get storeButtonImageName () : String { return _storeButtonImageName; }

	}
}